//
// Created by changlei on 2022/3/31.
//

import Foundation


struct Subjects: Codable {
    let subjects: [Subject]
}

@objcMembers class Subject: NSObject, Viewable {
    var isPlayable: Bool {
        get {
            playable
        }
    }
    var coverRate: Double {
        get {
            coverY / coverX
        }
    }

    let cover: String
    let coverX: Double
    let coverY: Double
    let episodesInfo: String
    let id: String
    let isNew: Bool
    let playable: Bool
    let rate: String
    let title: String
    let url: String

    enum CodingKeys: String, CodingKey {
        case cover
        case coverX = "cover_x"
        case coverY = "cover_y"
        case episodesInfo = "episodes_info"
        case id
        case isNew = "is_new"
        case playable
        case rate
        case title
        case url
    }

    func copy(with zone: NSZone?) -> Any {
        self
    }
}